package com.zouma.service;


import com.zouma.dao.UserRepository;
import com.zouma.pojo.User;
import com.zouma.util.MD5Util;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Author: serein
 * @DateTime: 2021/7/27 15:51
 * @Description:
 */
@Service
public class UserServiceImpl implements UserService{

    @Autowired
    private UserRepository userRepository;

    @Override
    public User checkUser(String username, String password) {
        User user = userRepository.findByUsernameAndPassword(username, MD5Util.code(password));
        return user;
    }
}